<template>
   <div id="top">
       <span class="back" @click="back" v-show="isShow"> &lt; </span>
       <marquee behavior="alternate" direction="left">警告:当前在"{{navTitle}}"的页面。{{fatherComponent}}</marquee>
   </div>
</template>

<script>
import { mapGetters, mapActions } from "vuex";
export default {
  computed: mapGetters(["isShow", "navTitle"]),
  data() {
    return {};
  },
  methods: {
    back() {
      window.history.back();
      window.sessionStorage.setItem("isShow", false);
      this.$store.dispatch("showORhide", false);
    }
  },
  props: ["fatherComponent"],
};
</script>

<style scoped>
#top {
  position: fixed;
  top: 0;
  width: 100%;
  height: 0.5rem;
  line-height: 0.5rem;
  background-color: #e8e8e8;
  text-align: center;
  overflow: hidden;
  z-index: 2;
}

.back {
  width: 0.5rem;
  height: 0.5rem;
  background-color: orange;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
}
marquee {
  color: red;
  font-weight: bold;
  font-size: 0.3rem;
}
</style>
